import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ceo_app/components/Text.dart';
import './content.dart';

class Circle extends StatefulWidget {
  final Map arguments;

  const Circle({super.key, required this.arguments});

  @override
  State<Circle> createState() => _CircleState();
}

class _CircleState extends State<Circle> {
  @override
  void initState() {
    super.initState();
    print(widget.arguments);
  }

  @override
  Widget build(BuildContext context) {
    final size = MediaQuery.of(context).size;
    final width = size.width;
    final height = size.height;
    print(width);
    return Scaffold(
      // appBar: PreferredSize(
      //   preferredSize: const Size.fromHeight(193),
      //   child: AppBar(
      //     leading: IconButton(
      //         icon: const Icon(Icons.arrow_back_ios_new_rounded),
      //         onPressed: () {
      //           Navigator.of(context).pop();
      //         }),
      //     backgroundColor: const Color.fromRGBO(0, 0, 0, 0.5),
      //   ),
      // ),
      appBar: AppBar(
          leading: IconButton(
              icon: const Icon(Icons.arrow_back_ios_new_rounded),
              onPressed: () {
                Navigator.of(context).pop();
              }),
          backgroundColor: const Color.fromARGB(255, 110, 108, 108),
          elevation: 0), // 去除底部阴影
      body: Stack(
        children: [
          const OrderPage(),
          Positioned(
              top: 0,
              left: 0,
              height: 150.h,
              width: width,
              child: Container(
                padding: EdgeInsets.fromLTRB(26.w, 34.h, 90.w, 0),
                decoration: const BoxDecoration(
                    color: Color.fromARGB(255, 110, 108, 108)),
                child: Row(
                  crossAxisAlignment: CrossAxisAlignment.center,
                  children: [
                    Container(
                      width: 60.w,
                      height: 60.w,
                      margin: EdgeInsets.only(right: 10.w),
                      decoration: ShapeDecoration(
                          image: const DecorationImage(
                              image: NetworkImage(
                                'https://img0.baidu.com/it/u=3225684515,1663851432&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
                              ),
                              fit: BoxFit.cover),
                          shape: RoundedRectangleBorder(
                              borderRadius:
                                  BorderRadiusDirectional.circular(10))),
                    ),
                    Expanded(
                      flex: 1,
                      child: Column(
                          mainAxisAlignment: MainAxisAlignment.center,
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            TextContainer(
                                text: '喵星人的日常',
                                fontWeight: FontWeight.w600,
                                bgColor: Colors.red,
                                onClickTxt: () {
                                  print('fafafafa');
                                }
                                // style: TextStyle(
                                //     fontSize: 16.w,
                                //     color: Colors.white,
                                //     fontWeight: FontWeight.w600),
                                ),
                            Text(
                              '分享你和小猫咪的真实点大发；李芳芳拉风龙；啊',
                              maxLines: 1,
                              overflow: TextOverflow.ellipsis,
                              style: TextStyle(
                                fontSize: 14.w,
                                color: Colors.white,
                              ),
                            ),
                          ]),
                    )
                  ],
                ),
                // child: ListTile(
                //   leading: ClipRRect(
                //       borderRadius: BorderRadius.circular(10),
                //       child: Image.network(
                //         'https://img0.baidu.com/it/u=3225684515,1663851432&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
                //         width: 60,
                //         height: 60,
                //         fit: BoxFit.cover,
                //       )),
                //   title: const Text('dadaffff'),
                //   subtitle: const Text('二级'),
                // ),
              )),
          Positioned(
            bottom: 20,
            right: 14,
            child: GestureDetector(
                onTap: () {
                  Navigator.pushNamed(context, '/publish');
                },
                child: Container(
                  alignment: Alignment.center,
                  width: 100,
                  height: 40,
                  decoration: const BoxDecoration(
                      color: Color(0xff222222),
                      borderRadius: BorderRadius.all(Radius.circular(21))),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      Image.asset(
                        'assets/images/orangeAdd.png',
                        height: 12,
                        width: 12,
                      ),
                      const Text(
                        '分享有趣',
                        style: TextStyle(
                            fontSize: 14,
                            color: Colors.white,
                            fontWeight: FontWeight.w500),
                      )
                    ],
                  ),
                )),
          ),
        ],
      ),
      // floatingActionButton: Container(
      //     height: 40,
      //     width: 120,
      //     margin: EdgeInsets.only(bottom: 10),
      //     padding: const EdgeInsets.all(10),
      //     decoration: BoxDecoration(
      //         color: const Color.fromRGBO(34, 34, 34, 1),
      //         borderRadius: BorderRadius.circular(20)),
      //     // child: FloatingActionButton(
      //     //   onPressed: () {},
      //     //   child: const Icon(Icons.add),
      //     // ),
      //     child: Row(
      //       mainAxisAlignment: MainAxisAlignment.center,
      //       children: [
      //         Icon(
      //           Icons.add,
      //           color: Colors.red,
      //           size: 20,
      //         ),
      //         FloatingActionButton(
      //           onPressed: () {},
      //           child: SizedBox(width: 100, child: Text('分享')),
      //           // shape: ShapeBorder,
      //           // backgroundColor: Color.fromRGBO(34, 34, 34, 1),
      //           backgroundColor: Colors.red,
      //         ),
      //         // TextButton(
      //         //   child: Text('分享有趣'),
      //         //   onPressed: () {},
      //         //   // style: TextStyle(color: Colors.white),
      //         // )
      //       ],
      //     )
      //     ),
    );
  }
}
